--[[

        items.lua
        exported by excel2lua.py
        from file:items.xlsx

--]]

local _data = {
  [1] = {id = 1,name = '小血瓶',type = 1,value = 10,res = 'item1',},
  [2] = {id = 2,name = '大血瓶',type = 1,value = 10,res = 'item2',},
  [3] = {id = 3,name = '小蓝瓶',type = 2,value = 10,res = 'item3',},
  [4] = {id = 4,name = '大蓝瓶',type = 2,value = 10,res = 'item4',},
  [5] = {id = 5,name = '小经验书',type = 3,value = 10,res = 'item6',},
  [6] = {id = 6,name = '中经验书',type = 3,value = 50,res = 'item7',},
  [7] = {id = 7,name = '大经验书',type = 3,value = 150,res = 'item8',},
}

local id_to_index={
   [1] = 1,
   [2] = 2,
   [3] = 3,
   [4] = 4,
   [5] = 5,
   [6] = 6,
   [7] = 7,
}

local items={}

function items.length() 
   return #_data 
end 

function items.indexOf(index) 
   return _data[index] 
end 

function items.get(id) 
  return items.indexOf(id_to_index[id])
end 

return items